﻿<Page x:Class="WpfControlss.ListBoxSample"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      mc:Ignorable="d" 
      d:DesignHeight="301" d:DesignWidth="769"
	Title="ListBoxSample">
    <Grid>
        <ListBox Width="644" TextSearch.TextPath="Background" Height="93" Margin="25,12,100,196">
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <VirtualizingStackPanel Orientation="Horizontal" />
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
            <TextBlock Background="LightCyan"  TextSearch.Text="LightCyan"
                           Text="{Binding RelativeSource={RelativeSource Mode=Self},Path=Background}" Margin="5" Height="30" Width="100"/>
            <TextBlock Background="LightCoral"  TextSearch.Text="LightCoral"  Text="{Binding RelativeSource={RelativeSource Mode=Self},Path=Background}" Margin="5" Height="30" Width="100"/>
            <TextBlock Background="LightBlue"  TextSearch.Text="LightBlue" Text="{Binding RelativeSource={RelativeSource Mode=Self},Path=Background}" Margin="5" Height="30" Width="100"/>
            <TextBlock Background="LightGoldenrodYellow"  Text="{Binding RelativeSource={RelativeSource Mode=Self},Path=Background}" Margin="5" Height="30" Width="100"/>
            <TextBlock Background="LightGreen"  Text="{Binding RelativeSource={RelativeSource Mode=Self},Path=Background}" Margin="5" Height="30" Width="100"/>
            <TextBlock Background="LightGray"  Text="{Binding RelativeSource={RelativeSource Mode=Self},Path=Background}" Margin="5" Height="30" Width="100"/>
        </ListBox>
        <ListBox Margin="20,111,600,100" TextSearch.TextPath="Text">
            <TextBlock Text="AAAAAAAAAAAA" />
            <TextBlock Text="BBBBBBBBBB" />
            <TextBlock Text="CCCCCCCCCCCC" />
            <TextBlock Text="DDDDDDDDDDDD" />
            <TextBlock Text="ggggg" />
            <TextBlock Text="ff" />
            <TextBlock Text="ff" />
        </ListBox>
        <ListBox Margin="200,109,420,102" TextSearch.TextPath="Text" ScrollViewer.CanContentScroll="False">
            <TextBlock Text="AAAAAAAAAAAA" />
            <TextBlock Text="BBBBBBBBBB" />
            <TextBlock Text="CCCCCCCCCCCC" />
            <TextBlock Text="DDDDDDDDDDDD" />
            <TextBlock Text="ggggg" />
            <TextBlock Text="ff" />
            <TextBlock Text="ff" />
        </ListBox>
    </Grid>
</Page>
